#!/usr/bin/env bash

echo "Clearing Magento cache..."

rm -f ${MAGENTO_ROOT}/app/etc/paths.php
#clear var
for dir in `ls ${MAGENTO_ROOT}/var` ; do
    rm -rf ${MAGENTO_ROOT}/var/${dir}/* ;
done
#clear pub/statics
cd ${MAGENTO_ROOT}/pub && mv static/.htaccess static_htaccess.back && rm -rf static/* && mv static_htaccess.back static/.htaccess
#clear integration tests tmp
cd ${MAGENTO_ROOT}/dev/tests/integration && mv tmp/.gitignore tmp_gitignore.back && rm -rf tmp/* && mv tmp_gitignore.back tmp/.gitignore
#clear unit tests tmp
cd ${MAGENTO_ROOT}/dev/tests/unit && rm -rf tmp/*

echo "Magento cache cleared."
